package gui.panels.tab;

import javax.swing.table.DefaultTableModel;

public class TableModelResultat extends DefaultTableModel{

	public TableModelResultat() {
		super(new Object [][] {}, new String [] {"Titre choisi", "Proportion"});
	}
	
	@Override
	public boolean isCellEditable(int row, int column) {
		return false;
	}
	
	public void clear() {
		int size = getRowCount();
		for (int i=0; i<size; i++) {
			removeRow(0);
		}
	}
	
	public void addCouple(String titre, Object proportion) {
		Object[] rowData = new Object[]{titre, proportion};
		addRow(rowData);
	}
	
	public void addNoSolution() {
		Object[] rowData = new Object[]{"Solutions :", "AUCUNE"};
		addRow(rowData);
	}
	
}
